/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ConsultaEleccion.java
 *
 * Created on 14/11/2010, 05:00:15 PM
 */
package zonasoft.Vistas.Funcionales;

import com.mysql.jdbc.Connection;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
//import zonasoft.Conceptos.firmante;
import javax.swing.JTextField;
import javax.swing.ListModel;
import zonasoft.Conceptos.Eleccion;
import zonasoft.Conceptos.Especiales.Barrio;
import zonasoft.Conceptos.Lider;
import zonasoft.Conceptos.Puesto;
import zonasoft.Conceptos.Usuario;
import zonasoft.Manejadores.ManejadorBaseDatos;
//import zonasoft.Manejadores.ManejadorSimpatizante;
import zonasoft.Manejadores.ManejadorEleccion;
import zonasoft.Manejadores.ManejadorLider;
import zonasoft.Manejadores.ManejadorLugar;
import zonasoft.Manejadores.ManejadorPuesto;
import zonasoft.Manejadores.ManejadorUsuario;
import zonasoft.Utilidades.Control;
import zonasoft.Utilidades.HTTPRequestPoster;
import zonasoft.Utilidades.ProcuraduriaInfo;
import zonasoft.Vistas.inicioSesion;

/**
 *
 * @author JORGE
 */
public class ModificarLider extends javax.swing.JDialog {

    List listaBarrios = new ArrayList();
    HashMap<String, Integer> barrio;
    List<Barrio> barrioActual = new ArrayList<Barrio>();
    private HashMap<String, Integer> puestos;
    DefaultListModel modelistaOrganizaciones = new DefaultListModel();

    /** Creates new form ConsultaEleccion */
    public ModificarLider(java.awt.Frame parent) {
        super(parent, true);
        initComponents();
        pack();
        Rectangle parentBounds = parent.getBounds();
        Dimension size = getSize();
        // Center in the parent
        int x = Math.max(0, parentBounds.x + (parentBounds.width - size.width) / 2);
        int y = Math.max(0, parentBounds.y + (parentBounds.height - size.height) / 2);
        setLocation(new Point(x, y));

        habilitar.setVisible(false);
        deshabilitar.setVisible(false);
        comboPuestos1.setVisible(false);
        nombrePuestoC.setVisible(false);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jXTaskPaneContainer1 = new org.jdesktop.swingx.JXTaskPaneContainer();
        jLabel1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        campoId = new javax.swing.JTextField();
        campoNombre = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        campoProfesion = new javax.swing.JTextField();
        campoCelular = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        campoDireccion = new javax.swing.JTextArea();
        campoCorreo = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        campoApellido = new javax.swing.JTextField();
        campoFecha = new org.jdesktop.swingx.JXDatePicker();
        jLabel17 = new javax.swing.JLabel();
        comboSexo = new javax.swing.JComboBox();
        comboBarrio = new javax.swing.JComboBox();
        verificarDatos = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        comboOrganizacion = new javax.swing.JComboBox();
        comboPuestos1 = new javax.swing.JComboBox();
        nombrePuestoC = new javax.swing.JLabel();
        jXPanel1 = new org.jdesktop.swingx.JXPanel();
        consultar = new javax.swing.JButton();
        BotonLimpiar = new javax.swing.JButton();
        RadioHabilitar = new javax.swing.JRadioButton();
        BotonModificar = new javax.swing.JButton();
        aceptar = new javax.swing.JButton();
        deshabilitar = new javax.swing.JButton();
        habilitar = new javax.swing.JButton();
        jXPanel3 = new org.jdesktop.swingx.JXPanel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        campoMesa = new javax.swing.JTextField();
        campoPuesto = new javax.swing.JTextField();
        jScrollPane3 = new javax.swing.JScrollPane();
        direccionPuesto = new javax.swing.JTextArea();
        jPanel2 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        labelUsuario = new javax.swing.JLabel();
        fecg = new org.jdesktop.swingx.JXDatePicker();
        jPanel3 = new javax.swing.JPanel();
        campoBarrio1 = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        ucg = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        ucg1 = new javax.swing.JLabel();
        campoBarrio2 = new javax.swing.JTextField();
        franja = new javax.swing.JTextField();
        alerta = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        listaOrganizaciones = new javax.swing.JList();

        setTitle("");

        jLabel1.setFont(new java.awt.Font("Lucida Bright", 1, 18));
        jLabel1.setText("Modificacion de Lideres");
        jXTaskPaneContainer1.add(jLabel1);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, java.awt.Color.gray, java.awt.Color.lightGray, java.awt.Color.darkGray, java.awt.Color.gray), "Datos Lideres", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Lucida Bright", 1, 12))); // NOI18N

        jLabel3.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel3.setText("Apellido");

        jLabel4.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel4.setText("Telefono");

        jLabel2.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel2.setText("Identificacion");

        campoId.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                campoIdActionPerformed(evt);
            }
        });
        campoId.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                campoIdKeyTyped(evt);
            }
        });

        campoNombre.setEditable(false);
        campoNombre.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                campoNombreKeyTyped(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel5.setText("Barrio");

        campoProfesion.setEditable(false);
        campoProfesion.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                campoProfesionKeyTyped(evt);
            }
        });

        campoCelular.setEditable(false);
        campoCelular.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                campoCelularKeyTyped(evt);
            }
        });

        jLabel8.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel8.setText("Direccion:");

        jLabel6.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel6.setText("Profesion");

        jLabel9.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel9.setText("Sexo");

        jLabel10.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel10.setText("Correo");

        campoDireccion.setColumns(20);
        campoDireccion.setEditable(false);
        campoDireccion.setRows(5);
        campoDireccion.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                campoDireccionKeyTyped(evt);
            }
        });
        jScrollPane1.setViewportView(campoDireccion);

        campoCorreo.setEditable(false);
        campoCorreo.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                campoCorreoKeyTyped(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel13.setText("Nombre");

        campoApellido.setEditable(false);
        campoApellido.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                campoApellidoKeyTyped(evt);
            }
        });

        campoFecha.setEditable(false);

        jLabel17.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel17.setText("Fecha de Nacimiento");

        comboSexo.setFont(new java.awt.Font("Lucida Bright", 2, 12));
        comboSexo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Masculino", "Femenino" }));

        listaraBarrios();

        verificarDatos.setFont(new java.awt.Font("Tahoma", 1, 12));
        verificarDatos.setText("Verificar Datos");
        verificarDatos.setEnabled(false);
        verificarDatos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                verificarDatosActionPerformed(evt);
            }
        });

        jLabel21.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel21.setText("Coordinador");

        listaraBarrios();
        comboOrganizacion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Independiente", "Adultos Mayores", "Cultura", "Deporte", "Discapacitados", "Electoral", "Madres Comunitarias", "Madres Fami", "Localidad", "Jóvenes", "Mujeres", "Politico", "Puesto de Votacion", "Transporte", "Simpatizante", "Zona" }));
        comboOrganizacion.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboOrganizacionActionPerformed(evt);
            }
        });

        //listarapuestos();
        comboPuestos1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboPuestos1ActionPerformed(evt);
            }
        });

        nombrePuestoC.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        nombrePuestoC.setText("Puesto de Vot.");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel13)
                    .addComponent(jLabel17)
                    .addComponent(jLabel10)
                    .addComponent(jLabel6)
                    .addComponent(jLabel8))
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(campoProfesion)
                        .addComponent(campoCorreo)
                        .addComponent(campoNombre)
                        .addComponent(campoId, javax.swing.GroupLayout.DEFAULT_SIZE, 200, Short.MAX_VALUE)
                        .addComponent(campoFecha, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(58, 58, 58)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(verificarDatos)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel9))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(comboSexo, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(campoApellido, javax.swing.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE)))))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel5))
                                .addGap(18, 18, 18))
                            .addComponent(jLabel21)
                            .addComponent(nombrePuestoC))
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(campoCelular, javax.swing.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE)
                            .addComponent(comboBarrio, 0, 257, Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(comboPuestos1, 0, 253, Short.MAX_VALUE)
                                    .addComponent(comboOrganizacion, 0, 253, Short.MAX_VALUE))))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(campoId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(verificarDatos))
                .addGap(21, 21, 21)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(campoNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(campoApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(campoFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17)
                    .addComponent(jLabel9)
                    .addComponent(comboSexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(campoCorreo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10))
                        .addGap(20, 20, 20)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addComponent(campoProfesion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(21, 21, 21)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(campoCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(20, 20, 20)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(comboBarrio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel21)
                            .addComponent(comboOrganizacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(comboPuestos1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(nombrePuestoC))))
                .addContainerGap())
        );

        jXPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED, java.awt.Color.lightGray, java.awt.Color.lightGray, java.awt.Color.gray, java.awt.Color.gray));

        consultar.setFont(new java.awt.Font("Lucida Bright", 1, 12));
        consultar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zonasoft/Vistas/iconos/search-icon2.png"))); // NOI18N
        consultar.setText(" consultar");
        consultar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                consultarActionPerformed(evt);
            }
        });

        BotonLimpiar.setFont(new java.awt.Font("Lucida Bright", 1, 12));
        BotonLimpiar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zonasoft/Vistas/iconos/limpiar.png"))); // NOI18N
        BotonLimpiar.setText("Limpiar");
        BotonLimpiar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonLimpiarActionPerformed(evt);
            }
        });

        RadioHabilitar.setFont(new java.awt.Font("Lucida Bright", 1, 12));
        RadioHabilitar.setText("Habilitar Campos");
        RadioHabilitar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                RadioHabilitarActionPerformed(evt);
            }
        });

        BotonModificar.setFont(new java.awt.Font("Lucida Bright", 1, 12));
        BotonModificar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zonasoft/Vistas/iconos/Box-Notes-icon.png"))); // NOI18N
        BotonModificar.setText("Modificar");
        BotonModificar.setEnabled(false);
        BotonModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BotonModificarActionPerformed(evt);
            }
        });

        aceptar.setFont(new java.awt.Font("Lucida Bright", 1, 12));
        aceptar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zonasoft/Vistas/iconos/ok 32.png"))); // NOI18N
        aceptar.setText("Aceptar");
        aceptar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aceptarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jXPanel1Layout = new javax.swing.GroupLayout(jXPanel1);
        jXPanel1.setLayout(jXPanel1Layout);
        jXPanel1Layout.setHorizontalGroup(
            jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(RadioHabilitar, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(consultar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(BotonModificar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(BotonLimpiar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 155, Short.MAX_VALUE)
                        .addComponent(aceptar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(9, Short.MAX_VALUE))
        );
        jXPanel1Layout.setVerticalGroup(
            jXPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel1Layout.createSequentialGroup()
                .addComponent(RadioHabilitar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(consultar, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BotonModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(BotonLimpiar, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(aceptar, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        deshabilitar.setFont(new java.awt.Font("Lucida Bright", 1, 12));
        deshabilitar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zonasoft/Vistas/iconos/lock-icon2.png"))); // NOI18N
        deshabilitar.setText("Deshabilitar");
        deshabilitar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deshabilitarActionPerformed(evt);
            }
        });

        habilitar.setFont(new java.awt.Font("Lucida Bright", 1, 12));
        habilitar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/zonasoft/Vistas/iconos/lock-off-icon2.png"))); // NOI18N
        habilitar.setText("Habilitar");
        habilitar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                habilitarActionPerformed(evt);
            }
        });

        jXPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Datos Electorales", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N

        jLabel14.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel14.setText("Puesto de Votacion");

        jLabel15.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel15.setText("# Mesa");

        jLabel16.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel16.setText("Direccion ");

        campoMesa.setEditable(false);
        campoMesa.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                campoMesaKeyTyped(evt);
            }
        });

        campoPuesto.setEditable(false);
        campoPuesto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                campoPuestoActionPerformed(evt);
            }
        });

        direccionPuesto.setColumns(20);
        direccionPuesto.setEditable(false);
        direccionPuesto.setRows(5);
        jScrollPane3.setViewportView(direccionPuesto);

        javax.swing.GroupLayout jXPanel3Layout = new javax.swing.GroupLayout(jXPanel3);
        jXPanel3.setLayout(jXPanel3Layout);
        jXPanel3Layout.setHorizontalGroup(
            jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jXPanel3Layout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE))
                    .addComponent(jLabel14)
                    .addComponent(campoPuesto, javax.swing.GroupLayout.DEFAULT_SIZE, 302, Short.MAX_VALUE))
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jXPanel3Layout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(jLabel15))
                    .addGroup(jXPanel3Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(campoMesa, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jXPanel3Layout.setVerticalGroup(
            jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel3Layout.createSequentialGroup()
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(campoPuesto, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(campoMesa, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jXPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jXPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addGap(46, 46, 46))
                    .addGroup(jXPanel3Layout.createSequentialGroup()
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
                        .addContainerGap())))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Auditoria", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N

        jLabel11.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel11.setText("Ingresado por");

        jLabel12.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel12.setText("el");

        labelUsuario.setVerticalAlignment(javax.swing.SwingConstants.TOP);

        fecg.setEditable(false);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel11)
                    .addComponent(jLabel12)
                    .addComponent(fecg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(49, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jLabel11)
                .addGap(4, 4, 4)
                .addComponent(labelUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel12)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
                .addComponent(fecg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Analisis Electoral", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12))); // NOI18N

        campoBarrio1.setEditable(false);

        jLabel26.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel26.setText("Reside en:");

        ucg.setText("ucg");

        jLabel27.setFont(new java.awt.Font("Lucida Bright", 0, 12));
        jLabel27.setText("Vota en:");

        ucg1.setText("ucg");

        campoBarrio2.setEditable(false);

        franja.setEditable(false);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel26)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(ucg, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE))
                            .addComponent(campoBarrio1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(campoBarrio2, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel27)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(ucg1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                    .addComponent(franja, javax.swing.GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel26)
                    .addComponent(ucg, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel27)
                    .addComponent(ucg1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(campoBarrio1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(campoBarrio2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(franja, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(36, Short.MAX_VALUE))
        );

        alerta.setFont(new java.awt.Font("Tahoma", 1, 11));
        alerta.setForeground(new java.awt.Color(255, 51, 51));
        alerta.setText("Importante.. hay datos por guardar.");
        alerta.setVisible(false);

        listaOrganizaciones.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                listaOrganizacionesMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(listaOrganizaciones);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jXPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                            .addComponent(jXPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jXTaskPaneContainer1, javax.swing.GroupLayout.PREFERRED_SIZE, 948, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(alerta, javax.swing.GroupLayout.PREFERRED_SIZE, 393, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(181, 181, 181)
                .addComponent(deshabilitar, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(36, 36, 36)
                .addComponent(habilitar, javax.swing.GroupLayout.PREFERRED_SIZE, 12, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(294, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jXTaskPaneContainer1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(alerta)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(habilitar, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(deshabilitar, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jXPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jXPanel3, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    String id = "";
    private void consultarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_consultarActionPerformed
        // TODO add your handling code here:
        ManejadorBaseDatos manejabd = ManejadorBaseDatos.getInstancia();
        try {
            manejabd.conectar();
            //ManejadorSimpatizante.conm=manejabd.getConexion();
            ManejadorLider.conm = manejabd.getConexion();
            ManejadorEleccion.conm = manejabd.getConexion();
            ManejadorPuesto.con = (Connection) manejabd.getConexion();
            ManejadorUsuario.conm = manejabd.getConexion();
            Map<String, String> resultados = null;
            //firmante f = new firmante();
            Lider li = new Lider();
            listaraPuestos();//listamos los puestos para la modificacion
//            Eleccion el=new Eleccion();
            //f = ManejadorSimpatizante.getFirmante(campoId.getText());
            id = campoId.getText().trim();
            li = ManejadorLider.getLider(campoId.getText().trim());
            //el=ManejadorEleccion.getEleccion(li.getIdEleccion());
//            if(li.getNombre().endsWith("_"))
//            {
//               habilitar.setEnabled(true);
//               deshabilitar.setEnabled(false);
//            }
//            else
//            {
//                deshabilitar.setEnabled(true);
//                habilitar.setEnabled(false);
//            }
            if (!campoId.getText().isEmpty()) {
                if (li != null) {
                    campoNombre.setText(li.getNombre().replace("_", ""));
                    campoApellido.setText(li.getApellido());
                    campoProfesion.setText(li.getCargo());
                    campoCelular.setText(li.getTelefono());
//                campoEleccion.setText(el.getNombre()+ " "+el.getPeriodoInicio()+"-"+el.getPeriodoFin());
                    campoDireccion.setText(li.getDireccion());
                    comboSexo.setSelectedIndex(li.getSexo());



//                Date fechaHoy = new Date();      
//                int edad=0 ;
//                edad = fechaHoy.getYear()-li.getFechaNacimiento().getYear();
                    campoFecha.setDate(li.getFechaNacimiento());
                    String nombreBarrio = li.getBarrio().toLowerCase();
                    int index = listaBarrios.indexOf(nombreBarrio);
                    comboBarrio.setSelectedIndex(index + 1);

                    campoCorreo.setText(li.getCorreo());

                    //Agregando ala lista las organizaciones alas que pertenece


                    String Pertenece = li.getComite();
                    if (Pertenece != null && !Pertenece.isEmpty()) {
                        String[] listaOrganizacionesP = Pertenece.split(",");
                        for (String org : listaOrganizacionesP) {
                            if (!org.equals("")) {
                                modelistaOrganizaciones.addElement(org);
                            }
                        }
                        listaOrganizaciones.setModel(modelistaOrganizaciones);
                    }
                    resultados = ManejadorLider.getDatosVotacion(li.getIdPuesto());
                    System.out.println("resultados = " + resultados);
//                 System.out.println("resultados.get(barrio)= " + resultados.get("barrio"));
//                 System.out.println("resultados.get(puesto) = " + resultados.get("puesto"));
                    if (resultados != null && !resultados.isEmpty()) {
                        campoPuesto.setText(resultados.get("puesto"));
                        campoMesa.setText(li.getMesa());
                        direccionPuesto.setText(resultados.get("barrio"));
                        // Parte de la franja
                        campoBarrio1.setText(li.getBarrio());
                        campoBarrio2.setText(resultados.get("barrio"));

                        boolean answer = false;
                        int terceraRespuesta = -1;
                        Map<String, Integer> unidadesByBarrio = null;

                        Object[] resultado = ManejadorLider.validarZonificacion(li.getBarrio(), resultados.get("barrio"));

                        unidadesByBarrio = (Map<String, Integer>) resultado[0];
                        answer = (Boolean) resultado[1];
                        terceraRespuesta = (Integer) resultado[2];
                        if (answer == true) {
                            franja.setBackground(Color.GREEN);
                        } else {
                            franja.setBackground(Color.red);
                        }
                        if (terceraRespuesta == 0) {
                            ucg.setText("UCG #" + String.valueOf(unidadesByBarrio.get(li.getBarrio().toLowerCase())));
                            ucg1.setText("UCG #" + String.valueOf(unidadesByBarrio.get(resultados.get("barrio").toLowerCase())));
                        } else {
                            ucg.setText(String.valueOf(terceraRespuesta));
                            ucg1.setText(String.valueOf(terceraRespuesta));
                        }
                        //              // usuario
                        Usuario us = null;
                        us = inicioSesion.userActual;
                        labelUsuario.setText(us.getLogin_usuario());

                        java.util.Date fechaC = new java.util.Date(li.getFechaCreacion().getTime());
//                  labelFecha.setText(fechaC);
                        fecg.setDate(fechaC);

                    }
                    verificarDatos.setEnabled(true);

                } else {
                    JOptionPane.showMessageDialog(null, " Busqueda sin resultados", "Busqueda sin resultados", JOptionPane.INFORMATION_MESSAGE);
                    limpiar();
                }
            } else {
                JOptionPane.showMessageDialog(null, "Por favor digite la identificacion", "Campo Vacio", JOptionPane.WARNING_MESSAGE);
            }

        } catch (Exception ex) {
            // Logger.getLogger(ConsultaEleccion.class.getName()).log(Level.SEVERE, null, ex);
//            JOptionPane.showMessageDialog(null, " Este Lider no Existe", "Busqueda sin resultados", JOptionPane.INFORMATION_MESSAGE);
            ex.printStackTrace();
        }

    }//GEN-LAST:event_consultarActionPerformed

    private void aceptarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_aceptarActionPerformed

    private void habilitarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_habilitarActionPerformed
        // TODO add your handling code here:
        ManejadorBaseDatos manejabd = ManejadorBaseDatos.getInstancia();
        try {
            manejabd.conectar();
            //ManejadorSimpatizante.conm=manejabd.getConexion();
            ManejadorLider.con = manejabd.getConexion();
            //firmante f = new firmante();
            Lider li = new Lider();
            //f = ManejadorSimpatizante.getFirmante(campoId.getText());
            li = ManejadorLider.getLider(campoId.getText());
//              us=inicioSesion.userActual;

            if (li != null) {
                ManejadorLider.updateLiderDeshabilitar(li, campoId.getText(), 1);
                JOptionPane.showMessageDialog(null, "Lider habilitado correctamente", "Actualizacón correcta", JOptionPane.INFORMATION_MESSAGE);
            } else {
                JOptionPane.showMessageDialog(null, "El Lider fue habilitado", "Actualizacón correcta", JOptionPane.INFORMATION_MESSAGE);
            }
        } catch (Exception ex) {
            // Logger.getLogger(ConsultaEleccion.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, " Error en la insercion en la DB", "Actualización Fallida", JOptionPane.INFORMATION_MESSAGE);
            ex.printStackTrace();
        }
    }//GEN-LAST:event_habilitarActionPerformed

    private void campoIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_campoIdActionPerformed
        // TODO add your handling code here:
        consultarActionPerformed(evt);

    }//GEN-LAST:event_campoIdActionPerformed

    private void deshabilitarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deshabilitarActionPerformed
        // TODO add your handling code here:
        ManejadorBaseDatos manejabd = ManejadorBaseDatos.getInstancia();
        try {
            manejabd.conectar();
            //ManejadorSimpatizante.conm=manejabd.getConexion();
            ManejadorLider.conm = manejabd.getConexion();
            //firmante f = new firmante();
            Lider li = new Lider();
            //f = ManejadorSimpatizante.getFirmante(campoId.getText());
            li = ManejadorLider.getLider(campoId.getText());
            //              us=inicioSesion.userActual;

            if (li != null) {
                ManejadorLider.updateLiderDeshabilitar(li, campoId.getText(), 0);
                JOptionPane.showMessageDialog(null, "Lider Deshabilitado correctamente", "Actualizacón correcta", JOptionPane.INFORMATION_MESSAGE);
            } else {
//                JOptionPane.showMessageDialog(null, "El usuario fue deshabilitado", "Actualizacón correcta", JOptionPane.INFORMATION_MESSAGE);
            }




        } catch (Exception ex) {
            // Logger.getLogger(ConsultaEleccion.class.getName()).log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(null, " Error en la insercion en la DB", "Actualización Fallida", JOptionPane.INFORMATION_MESSAGE);
            ex.printStackTrace();
        }
    }//GEN-LAST:event_deshabilitarActionPerformed

    private void BotonLimpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonLimpiarActionPerformed
        // TODO add your handling code here:
        limpiar();
        campoId.requestFocus();
}//GEN-LAST:event_BotonLimpiarActionPerformed

    private void campoIdKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoIdKeyTyped
        // TODO add your handling code here:
        validaNumeros(evt, campoId, 20);
    }//GEN-LAST:event_campoIdKeyTyped

    private void RadioHabilitarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_RadioHabilitarActionPerformed
        // TODO add your handling code here:
        habilitarCampos();
}//GEN-LAST:event_RadioHabilitarActionPerformed

    private void BotonModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BotonModificarActionPerformed
        // TODO add your handling code here:
        // Validacion de los campos
        if (campoNombre.getText().isEmpty()) {
            JOptionPane.showMessageDialog(null, "Campo nombre vacio", "Error", JOptionPane.WARNING_MESSAGE);
        } else if (campoNombre.isEditable() == false) {
            BotonModificar.setEnabled(false);
        } else if (campoApellido.getText().isEmpty()) {
            JOptionPane.showMessageDialog(null, "campo apellido vacio", "Error", JOptionPane.WARNING_MESSAGE);
        } else if (campoProfesion.getText().isEmpty()) {
            JOptionPane.showMessageDialog(null, "campo Profesion vacio", "Error", JOptionPane.WARNING_MESSAGE);
        } else if (campoCelular.getText().isEmpty()) {
            JOptionPane.showMessageDialog(null, "campo telefono vacio", "Error", JOptionPane.WARNING_MESSAGE);
        } else if (!campoCorreo.getText().contains("@") || !campoCorreo.getText().contains(".")) {
            JOptionPane.showMessageDialog(null, "Correo Invalido", "error", JOptionPane.WARNING_MESSAGE);
        } else {
            ManejadorBaseDatos manejabd = ManejadorBaseDatos.getInstancia();
            try {
                manejabd.conectar();
                ManejadorLider.con = manejabd.getConexion();
                Lider li = new Lider();
                String ide = campoId.getText().trim();
                //Datos del Lider
                li.setIdLider(campoId.getText());
                li.setNombre(campoNombre.getText());
                li.setApellido(campoApellido.getText());
                li.setFechaNacimiento(campoFecha.getDate());
                int sexo = (li.getSexo());
                comboSexo.setSelectedIndex(sexo);
                li.setSexo(comboSexo.getSelectedIndex());
                li.setCargo(campoProfesion.getText());
                li.setTelefono(campoCelular.getText());
                li.setCorreo(campoCorreo.getText());
//////                zon.setCodHoja(campoRef.getText());
                li.setDireccion(campoDireccion.getText());
                li.setBarrio(comboBarrio.getSelectedItem().toString());
                li.setMesa(campoMesa.getText().toString());
                String puestoNew = campoPuesto.getText();
                int idNuevoPuesto = puestos.get(puestoNew);
                li.setIdPuesto(String.valueOf(idNuevoPuesto));

                int nOrganizaciones = listaOrganizaciones.getModel().getSize();
                ListModel modelo = listaOrganizaciones.getModel();
                String organizaciones = "";
                for (int i = 0; i < nOrganizaciones; i++) {
                    String org = modelo.getElementAt(i).toString();
                    if (!org.equals("")) {
                        organizaciones += org + ",";
                    }
                }
                //para eliminar la ultima coma
                if (organizaciones.lastIndexOf(",") > 0) {
                    organizaciones = organizaciones.substring(0, organizaciones.lastIndexOf(","));
                }
                li.setComite(organizaciones);

                int idPuestoC = 0;
                if (comboPuestos1.getSelectedIndex() > 0) {
                    String nombrePuestoCo = comboPuestos1.getSelectedItem().toString();
                    idPuestoC = puestos.get(nombrePuestoCo);
                    li.setIdPuestoCoordinado(String.valueOf(idPuestoC));
                }
//////                // datos del Lider
//
//                                System.out.println("Ide ( lider viejo) = " + id);
//                                System.out.println("IdZ (lider nuevo)  = " + ide);
//                                System.out.println("li = " + li.getApellido()+ li.getNombre());
                ManejadorLider.ModificarLider(li, id);
                JOptionPane.showMessageDialog(null, " lider modificado con exito", " Modificacion Exitosa", JOptionPane.INFORMATION_MESSAGE);
                limpiar();
                deshabilitar();
                verificarDatos.setEnabled(false);
                alerta.setVisible(false);


            } catch (Exception ex) {
                Logger.getLogger(ModificarLider.class.getName()).log(Level.SEVERE, null, ex);
            }
        }  // else}

}//GEN-LAST:event_BotonModificarActionPerformed

    private void campoNombreKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoNombreKeyTyped
        // TODO add your handling code here:
        Control.validaLetras(evt, campoNombre, 45);
    }//GEN-LAST:event_campoNombreKeyTyped

    private void campoApellidoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoApellidoKeyTyped
        // TODO add your handling code here:
        Control.validaLetras(evt, campoApellido, 45);
    }//GEN-LAST:event_campoApellidoKeyTyped

    private void campoCorreoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoCorreoKeyTyped
        // TODO add your handling code here:
        Control.validaCantidad(evt, campoCorreo, 45);
    }//GEN-LAST:event_campoCorreoKeyTyped

    private void campoCelularKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoCelularKeyTyped
        // TODO add your handling code here:
        Control.validaNumeros(evt, campoCelular, 45);
    }//GEN-LAST:event_campoCelularKeyTyped

    private void campoProfesionKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoProfesionKeyTyped
        // TODO add your handling code here:
        Control.validaLetras(evt, campoProfesion, 45);
    }//GEN-LAST:event_campoProfesionKeyTyped

    private void campoDireccionKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoDireccionKeyTyped
        // TODO add your handling code here:
        Control.validaCantidadA(evt, campoDireccion, 45);
    }//GEN-LAST:event_campoDireccionKeyTyped

    private void campoMesaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_campoMesaKeyTyped
        // TODO add your handling code here:
        Control.validaNumeros(evt, campoMesa, 3);
    }//GEN-LAST:event_campoMesaKeyTyped

    private void verificarDatosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verificarDatosActionPerformed
        // TODO add your handling code here:
        String nombreZoni = campoNombre.getText();
        String apellidoZoni = campoApellido.getText();
        String puestoVota = campoPuesto.getText();
        String mesaVota = campoMesa.getText();
        String direccionVota = direccionPuesto.getText();


        // si el campo no esta vacio, consultame
        if (!campoId.getText().isEmpty()) {
            String id = campoId.getText().trim();
            HTTPRequestPoster.consultarDatos(id);
            String Departamento = HTTPRequestPoster.datosFinales.get("departamento");
            String municipio = HTTPRequestPoster.datosFinales.get("municipio");
            String puesto_ = HTTPRequestPoster.datosFinales.get("puesto");
            String mesa_ = HTTPRequestPoster.datosFinales.get("mesa");
            String direccion = HTTPRequestPoster.datosFinales.get("direccion");
            if (!puestoVota.equals(puesto_)) {
                campoPuesto.setText(puesto_);
                campoPuesto.setBackground(Color.getHSBColor(204, 59, 99));
                alerta.setVisible(true);
                BotonModificar.setEnabled(true);
                consultar.setEnabled(false);
                RadioHabilitar.setSelected(true);
                habilitarCampos();
            }

            //        if(!direccion.contentEquals(direccionVota))
            //        {
            //        direccionPuesto.setText(direccion);
            //        }

            if (!mesaVota.equals(mesa_)) {
                System.out.println(mesa_ + " == " + mesaVota);
                campoMesa.setText(mesa_);
                campoMesa.setBackground(Color.getHSBColor(204, 59, 99));
                alerta.setVisible(true);
                BotonModificar.setEnabled(true);
                consultar.setEnabled(false);
                RadioHabilitar.setSelected(true);
                habilitarCampos();
            }
            String[] datosPersonales = null;
            datosPersonales = ProcuraduriaInfo.informacionPersona(id);


            if (datosPersonales != null) {
                datosPersonales = datosProcuraduriaCorregidos(datosPersonales);

//                String nombreProcu = datosPersonales[0] + " " + datosPersonales[1];
//                String apellidoProcu = datosPersonales[2] + " " + datosPersonales[3];
                String nombreProcu = datosPersonales[0];
                String apellidoProcu = datosPersonales[1];
                if (!nombreZoni.equals(nombreProcu)) {
                    campoNombre.setText(nombreProcu);
                    campoNombre.setBackground(Color.getHSBColor(204, 59, 99));
                    alerta.setVisible(true);
                    BotonModificar.setEnabled(true);
                    consultar.setEnabled(false);
                    RadioHabilitar.setSelected(true);
                    habilitarCampos();
                }
                if (!apellidoZoni.equals(apellidoProcu)) {
                    campoApellido.setText(apellidoProcu);
                    campoApellido.setBackground(Color.getHSBColor(204, 59, 99));
                    alerta.setVisible(true);
                    BotonModificar.setEnabled(true);
                    consultar.setEnabled(false);
                    RadioHabilitar.setSelected(true);
                    habilitarCampos();
                }

            }
        } else {
            JOptionPane.showMessageDialog(null, "campo identificacion vacio", "campos vacio", JOptionPane.WARNING_MESSAGE);
        }
}//GEN-LAST:event_verificarDatosActionPerformed

    private void campoPuestoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_campoPuestoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_campoPuestoActionPerformed

    private void comboOrganizacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboOrganizacionActionPerformed
        // TODO add your handling code here:
        String opcion = comboOrganizacion.getSelectedItem().toString();
        int nOrganizaciones = listaOrganizaciones.getModel().getSize();
        ListModel modelo = listaOrganizaciones.getModel();
        boolean esta = false;
        for (int i = 0; i < nOrganizaciones; i++) {
            String org = modelo.getElementAt(i).toString();
            if (org.equals(opcion)) {
                esta = true;
                break;
            }

        }
        if (!esta) {
            modelistaOrganizaciones.addElement(opcion);
            listaOrganizaciones.setModel(modelistaOrganizaciones);

        }
        if (opcion.equals("Puesto de Votacion")) {
            comboPuestos1.setVisible(true);
            nombrePuestoC.setVisible(true);
        } else {
            comboPuestos1.setVisible(false);
            nombrePuestoC.setVisible(false);
            BotonModificar.setEnabled(true);
        }
}//GEN-LAST:event_comboOrganizacionActionPerformed

    private void comboPuestos1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboPuestos1ActionPerformed
        // TODO add your handling code here:
        String opcion = comboOrganizacion.getSelectedItem().toString();
        if (opcion.equals("Puesto de Votacion") && comboPuestos1.getSelectedIndex() == 0) {
            BotonModificar.setEnabled(false);
        } else {
            BotonModificar.setEnabled(true);
        }
}//GEN-LAST:event_comboPuestos1ActionPerformed

    private void listaOrganizacionesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_listaOrganizacionesMouseClicked
        // TODO add your handling code here:
        if (evt.getClickCount() == 2) {
            int index = listaOrganizaciones.locationToIndex(evt.getPoint());
            modelistaOrganizaciones.remove(index);
            listaOrganizaciones.setModel(modelistaOrganizaciones);
        }
    }//GEN-LAST:event_listaOrganizacionesMouseClicked

    public String[] datosProcuraduriaCorregidos(String[] datos) {
        String[] datosOk = new String[2];
        int tam = datos.length;
        int n = tam;
        boolean tieneDe = false;
        System.out.println("tam = " + tam);
        String name = "";

        for (String d : datos) {
            if (d.equalsIgnoreCase("de")) {
                tieneDe = true;
                break;

            }

        }
        if (tieneDe) {
            n = tam - 1;
        }

        for (int i = 0; i < (n - 2); i++) {
            name += datos[i] + " ";


        }
        datosOk[0] = name;
        if (!tieneDe) {
            datosOk[1] = datos[tam - 2] + " " + datos[tam - 1];
        } else {
            datosOk[1] = datos[tam - 3] + " DE " + datos[tam - 1];
        }

        return datosOk;
    }

    private void habilitarCampos() {
        if ((campoId.getText().isEmpty()) && (campoNombre.getText().isEmpty())) {
            RadioHabilitar.setSelected(false);
            JOptionPane.showMessageDialog(null, "No hay campos que modificar", "Campos Vacios", JOptionPane.ERROR_MESSAGE);
            campoId.requestFocus();
        } else {
            if (RadioHabilitar.isSelected() == true) {
                campoNombre.setEditable(true);
                campoApellido.setEditable(true);
                comboSexo.setEnabled(true);
                campoProfesion.setEditable(true);
                campoCelular.setEditable(true);
                campoCorreo.setEditable(true);
                campoDireccion.setEditable(true);
                comboBarrio.setEnabled(true);
                campoFecha.setEditable(true);
                BotonModificar.setEnabled(true);
                consultar.setEnabled(false);
                campoId.requestFocus();
            } else {
                deshabilitar();
            }
            if (campoNombre.isEditable() == false) {
                RadioHabilitar.setSelected(false);
                BotonModificar.setEnabled(false);
            }
        }
    }

    public void limpiar() {
        campoId.setText("");
        campoNombre.setText("");
        campoApellido.setText("");
        campoCelular.setText("");
        campoFecha.setDate(null);
        campoDireccion.setText("");
        campoProfesion.setText("");
        campoPuesto.setText("");
        campoMesa.setText("");
        campoCorreo.setText("");

        direccionPuesto.setText("");
        campoBarrio1.setText("");
        campoBarrio2.setText("");
        franja.setBackground(campoBarrio1.getBackground());
        alerta.setVisible(false);
        campoNombre.setBackground(campoCelular.getBackground());
        campoApellido.setBackground(campoCelular.getBackground());
        campoMesa.setBackground(campoCelular.getBackground());
        campoPuesto.setBackground(campoCelular.getBackground());

        modelistaOrganizaciones = new DefaultListModel();
        listaOrganizaciones.setModel(modelistaOrganizaciones);
    }

    public void deshabilitar() {
        campoNombre.setEditable(false);
        campoApellido.setEditable(false);
        comboSexo.setEnabled(false);
        campoProfesion.setEditable(false);
        campoCelular.setEditable(false);
        campoCorreo.setEditable(false);
        campoDireccion.setEditable(false);
        comboBarrio.setEnabled(false);
        campoFecha.setEditable(false);
        RadioHabilitar.setSelected(false);
        BotonModificar.setEnabled(false);

        consultar.setEnabled(true);
        campoId.requestFocus();
    }

    public void listaraBarrios() {
        ManejadorBaseDatos mbd = ManejadorBaseDatos.getInstancia();
        barrio = new HashMap<String, Integer>();
        try {
            mbd.conectar();
            ManejadorLugar.con = (Connection) mbd.getConexion();
            comboBarrio.removeAllItems();

            List listarBarrio = null;
            listarBarrio = ManejadorLugar.listarBarrios();
            barrioActual = listarBarrio;
            Iterator<Barrio> iter = listarBarrio.iterator();
            Barrio bar = null;
            comboBarrio.addItem("-- Seleccione un Barrio --");
            while (iter.hasNext()) {
                bar = iter.next();
                listaBarrios.add(bar.getNombre().toLowerCase());
                int idBarrio = Integer.parseInt(bar.getIdBarrio());
                comboBarrio.addItem(bar.getNombre());
                barrio.put(bar.getNombre(), idBarrio);

            }
        } catch (Exception ex) {
            Logger.getLogger(ModificarLider.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public Barrio buscarBarrio(String id) {
        Barrio ba = null;
        for (Barrio barrio_ : barrioActual) {
            if (barrio_.getIdBarrio().equals(id)) {
                ba = barrio_;
                break;
            }
        }
        return ba;
    }

    private void validaNumeros(java.awt.event.KeyEvent evt, JTextField campo, int numero) {
        int caracter = (int) evt.getKeyChar();
        char letra = ((char) caracter);

        int n = campo.getText().length() + 1;
        if (n > numero) {
            evt.setKeyChar((char) KeyEvent.VK_CLEAR);
            campo.setToolTipText(("<html> <center> <h1> Advertencia </h1>" + "<h2 Style='color: red; font-style: italic;'> No puede superar la cantidad de caracteres permitidos </h2>"
                    + "<b>" + --n + " <br/> Es el maximo  para este campo </b> </center>"
                    + "<br/> Compruebe sus datos."));
        }

        //           solo numeros               retroceso       ctrl+c           ctrl + v          ctrl + x          supri                  -
        if (caracter >= 48 && caracter <= 57 || caracter == 8 || caracter == 3 || caracter == 22 || caracter == 24 || caracter == 27 || caracter == 45) {
        } else {
//        int numeropermitido = campo.getText().length();
            evt.setKeyChar((char) KeyEvent.VK_CLEAR);
            campo.setToolTipText(("<html> <center> <h1> Advertencia </h1>"
                    + "<h2 Style='color: red; font-style: italic;'> Ingrese numeros por favor </h2>"
                    + "<b> " + letra + "<br/> no es un numero </b> </center>"
                    + "<br/> Compruebe sus datos."));
        }
    }

    public void listaraPuestos() {
        ManejadorBaseDatos mbd = ManejadorBaseDatos.getInstancia();
        puestos = new HashMap<String, Integer>();
        try {
            mbd.conectar();
            ManejadorPuesto.con = (Connection) mbd.getConexion();
            List listarPuestos = null;

            listarPuestos = ManejadorPuesto.listarPuestos();
            Iterator<Puesto> iter = listarPuestos.iterator();
            Puesto pue = null;
            comboPuestos1.addItem("-- Seleccione un Puesto --");
            while (iter.hasNext()) {
                pue = iter.next();
//                    System.out.println("pue.getIdPuesto() = " + pue.getIdPuesto());
                int codigoPuesto = Integer.parseInt(pue.getIdPuesto());
                String nombre = pue.getNombrePuesto();
                comboPuestos1.addItem(nombre);
                puestos.put(nombre, codigoPuesto);
//           puestos2.put(pue.getIdPuesto(), nombre );
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }// fin del listar Puestos
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BotonLimpiar;
    private javax.swing.JButton BotonModificar;
    private javax.swing.JRadioButton RadioHabilitar;
    private javax.swing.JButton aceptar;
    private javax.swing.JLabel alerta;
    private javax.swing.JTextField campoApellido;
    private javax.swing.JTextField campoBarrio1;
    private javax.swing.JTextField campoBarrio2;
    private javax.swing.JTextField campoCelular;
    private javax.swing.JTextField campoCorreo;
    private javax.swing.JTextArea campoDireccion;
    private org.jdesktop.swingx.JXDatePicker campoFecha;
    private javax.swing.JTextField campoId;
    private javax.swing.JTextField campoMesa;
    private javax.swing.JTextField campoNombre;
    private javax.swing.JTextField campoProfesion;
    private javax.swing.JTextField campoPuesto;
    private javax.swing.JComboBox comboBarrio;
    private javax.swing.JComboBox comboOrganizacion;
    private javax.swing.JComboBox comboPuestos1;
    private javax.swing.JComboBox comboSexo;
    private javax.swing.JButton consultar;
    private javax.swing.JButton deshabilitar;
    private javax.swing.JTextArea direccionPuesto;
    private org.jdesktop.swingx.JXDatePicker fecg;
    private javax.swing.JTextField franja;
    private javax.swing.JButton habilitar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private org.jdesktop.swingx.JXPanel jXPanel1;
    private org.jdesktop.swingx.JXPanel jXPanel3;
    private org.jdesktop.swingx.JXTaskPaneContainer jXTaskPaneContainer1;
    private javax.swing.JLabel labelUsuario;
    private javax.swing.JList listaOrganizaciones;
    private javax.swing.JLabel nombrePuestoC;
    private javax.swing.JLabel ucg;
    private javax.swing.JLabel ucg1;
    private javax.swing.JButton verificarDatos;
    // End of variables declaration//GEN-END:variables
}
